﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using iSufeMVC4.WebAPI.Models;

namespace iSufeMVC4.WebAPI.Controllers
{
    public class CourseController : ApiController
    {

        public ResultList<Course> List(UserDatetimeQuery query)
        {            
            Course c1 = new Course()
            {
                courseId = 1,
                name = "WangYuchen",
                address = "四教一楼",
                startTime = new DateTime(2009, 1, 19, 7, 30, 0),
                endtime = new DateTime(2009, 1, 20, 8, 0, 0),
                classNum = 12,
                teacher = new User()
                {
                    userId = 0,
                    name = "Joydragon",
                    className = "2007银行与国际金融2班",
                    avatarUrl = @"http://hdn.xnimg.cn/photos/hdn321/20120331/1405/tiny_7eOt_57692c019117.jpg",
                    status = 1
                }
            };
            Course c2 = new Course()
            {
                courseId = 2,
                name = "WangYuchen",
                address = "四教二楼",
                startTime = new DateTime(2010, 1, 19, 7, 30, 0),
                endtime = new DateTime(2010, 1, 20, 8, 0, 0),
                classNum = 12,
                teacher = new User()
                {
                    userId = 0,
                    name = "Joydragon",
                    className = "2007银行与国际金融2班",
                    avatarUrl = @"http://hdn.xnimg.cn/photos/hdn321/20120331/1405/tiny_7eOt_57692c019117.jpg",
                    status = 1
                }
            };
            List<Course> cc=new List<Course>();
            cc.Add(c1);
            cc.Add(c2);
            ResultList<Course> results = new ResultList<Course>()
            {
                startIndex = 0,
                isEnd = false,
                list = cc,
                nextStartIndex = 2
            };
            return results;
        }
    }
}
